function createEMREditor() {
  console.log("caoooooooooooooooooooooo")
  var sde = window.sde = new SDE({
    el: document.querySelector('#EMREDITOR'),
    footer: "还算有点用的废物毕业生编辑器啦",
    iframe_css_src: null, //string/Array数组 扩展css
    page_start_num: 6, //页面起始页//默认为1
    ctrl_remote_handle: function(data) {
      //这里可以处理url，对url进行再加工。如果此时执行 this.isLoadAsyncData(true)，则表示代替sde自带的异步请求方法，
      //场景1，二次处理发起异步请求前的参数设置，比如因模板打开路径不同，导致的控件中的url路径不对的问题；
      console.log(data);
      data.url = data.url + '?' + new Date().getTime();
      return data;
      //场景2，在该方法中执行异步请求。并量数据赋值
      // this.isLoadAsyncData(true);
      // var ctrl = this;
      // ajax(function (data) {
      //   //这里是请求成功
      //   ctrl.setBindingData(data.data);//这里是去除data的数据，一般为数组。
      //   if (ctrl.render) {
      //     ctrl.render(); //重新渲染
      //   }
      // }, function (err) {
      //   //这里是失败
      // });
    },
    toolbars: [{//本次更新，toolbar支持更大的定制功能，可自由排列，随意组合，任意命名。如不填默认为下列值：
      name: 'sde-toolbar-file',
      title: '文件',
      items: [{
        name: 'sde-toolbar-file-file',
        title: '文件管理',
        items: [{
          name: "savexml",
          title: "保存病历",
          render: function () {
             var e = document.createElement("div");
             return e.innerHTML = '<div class="panel-content-ctrl" title="保存病历" >\n            <div class="sde-icon sde-icon-savexml" style="width: 40px; height: 32px; float: none;"></div>\n            <div style="text-align: center;">保存病历</div>\n          </div>', e = e.firstElementChild, e.addEventListener("click", function () {
                //TODO
                savemyxml();
             }), e
          }
       },{
          name: 'openxml',
          title: '打开病历'
        }, {
          name: 'importxml',
          title: '下载病历'
        },{
              name: 'print',
              title: '打印'
        }]
        }]
    }, {
      name: 'sde-toolbar-editor',
      title: '编辑',
      items: [{
        name: 'sde-toolbar-editor-clipboard',
        title: '编辑板',
        items: [ {
          name: 'undo',
          title: '撤销'
        }, '|', {
          name: 'redo',
          title: '恢复'
        }]
      }, {
        name: 'sde-toolbar-editor-fonts',
        title: '字体格式',
        items: [{
          name: 'upsize',
          title: '增大字体'
        }, {
          name: 'downsize',
          title: '缩小字体'
        }, {
          name: 'superscript',
          title: '上标'
        }, {
          name: 'subscript',
          title: '下标'
        }, {
          name: 'bold',
          title: '加粗'
        }, {
          name: 'italic',
          title: '倾斜'
        }, {
          name: 'underline',
          title: '下划线'
        }, {
          name: 'strikethrough',
          title: '删除线'
        }, {
          name: 'forecolor',
          title: '文字颜色'
        }, {
          name: 'backcolor',
          title: '背景颜色'
        }, '|',{
          name: 'fontfamily',
          title: '字体'
        }, {
          name: 'fontsize',
          title: '字号'
        },{
          name: 'removeformat',
          title: '清除格式'
        }, {
          name: 'formatmatch',
          title: '格式刷'
        } ]
      }, {
        name: 'sde-toolbar-editor-paragraphs',
        title: '段落格式',
        items: [{
          name: 'justifyleft',
          title: '向左对齐'
        }, {
          name: 'justifycenter',
          title: '居中对齐'
        }, {
          name: 'justifyright',
          title: '向右对齐'
        }, {
          name: 'justifyjustify',
          title: '两端对齐'
        },{
          name: 'blockindent',
          title: '增加缩进'
        }, {
          name: 'blockoutdent',
          title: '减小缩进'
        }, '|', {
          name: 'unorderedlist',
          title: '无序编号'
        }, {
          name: 'orderedlist',
          title: '有序编号'
        }, {
          name: 'rowspacingtop',
          title: '段前距'
        }, {
          name: 'rowspacingbottom',
          title: '段后距'
        }, {
          name: 'lineheight',
          title: '行高'
        }]
      }
    ]
    }, {
      name: 'sde-toolbar-insert',
      title: '表格',
      items: [{
        name: 'sde-toolbar-table-table',
        title: '表格',
        items: [{
          name: 'inserttable',
          title: '插入表格'
        }, {
          name: 'deletetable',
          title: '删除表格'
        }, {
          name: 'insertrow',
          title: '插入行'
        }, {
          name: 'insertcol',
          title: '插入列'
        }, '|', {
          name: 'deleterow',
          title: '删除行'
        }, {
          name: 'deletecol',
          title: '删除列'
        }]
      }, {
        name: 'sde-toolbar-table-merge',
        title: '合并单元格',
        items: [{
          name: 'mergecells',
          title: '合并单元格'
        }, {
          name: 'mergedown',
          title: '向下合并单元格'
        }, {
          name: 'mergeright',
          title: '向右合并单元格'
        }, '|', {
          name: 'splittocells',
          title: '拆分单元格'
        }, {
          name: 'splittocols',
          title: '单元格拆分成列'
        }, {
          name: 'splittorows',
          title: '单元格拆分成行'
        }]
      }, {
        name: 'sde-toolbar-table-alignmerge',
        title: '对齐方向',
        items: [{
          name: 'valign-top',
          title: '顶端对齐'
        }, {
          name: 'valign-middle',
          title: '垂直居中'
        }, {
          name: 'valign-bottom',
          title: '底端对齐'
        }, '|', {
          name: 'align-left',
          title: '左对齐'
        }, {
          name: 'align-center',
          title: '居中'
        }, {
          name: 'align-right',
          title: '右对齐'
        }]
      }, {
        name: 'sde-toolbar-table-style',
        title: '表格线样式',
        items: [{
          name: 'tablestyle',
          title: '表格样式',
          items: [{
              title: '隐藏表格线',
              name: 'tb-hide' //这里是具体的样式
            },
            {
              title: '设为实线',
              name: 'tb-solid'
            },
            {
              title: '设为虚线',
              name: 'tb-dotted'
            }
          ]
        }, {
          name: 'tablelowerframeline',
          title: '下框线'
        }, {
          name: 'tableupperframeline',
          title: '上框线'
        }, {
          name: 'tableleftframeline',
          title: '左框线'
        }, {
          name: 'tablerightframeline',
          title: '右框线'
        }, {
          name: 'tablenoborder',
          title: '无框线'
        }, '|', {
          name: 'tableinternaltransverseline',
          title: '内部横线'
        }, {
          name: 'tableinternalverticalline',
          title: '内部竖线'
        }, {
          name: 'tableinsideborder',
          title: '内部框线'
        }, {
          name: 'tablelateralframeline',
          title: '外侧框线'
        }, {
          name: 'tableallframelines',
          title: '所有框线'
        }, ]
      }]
    }, {
      name: 'sde-toolbar-controls',
      title: '插入',
      items: [{
        name: 'sde-toolbar-controls-sdemode',
        title: '模式设置',
        items: [{
          name: 'sdemode',
          title: '模式设置'
        }]
      },{
        name: 'sde-toolbar-controls-controls',
        title: '病历标签',
        items: [{
          name: 'sdectrllabel',
          title: '普通文本'
        }, {
          name: 'sdectrltext',
          title: '校验文本'
        },  {
          name: 'sdectrldate',
          title: '日期标签'
        }, {
          name: 'sdectrlselect',
          title: '下拉框'
        },{
          name: 'sdectrlradio',
          title: '单选框'
        }, {
          name: 'sdectrlcbx',
          title: '复选框'
        }, {
          name: 'sdectrlsection',
          title: '文档段落'
        }]
      },{
        name: 'sde-toolbar-insert-images',
        title: '特殊内容',
        items: [{
          name: 'openinsertimage',
          title: '图片管理'
        }, {
          name: 'simpleupload',
          title: '插入'
        }, 
        // '|', 
        {
          name: 'scrawl',
          title: '涂鸦'
        },{
          name: 'kityformula',
          title: '公式'
        }, {
          name: 'spechars',
          title: '字符'
        },{
          name: 'pagebreak',
          title: '分页符'
        }]
      }]
    }],
    default_open_toolbar: 'sde-toolbar-file', //默认打开的toolbar的集合，如果不填，默认使用第一个集合
  });

  sde.addListener('ready',function(){
    console.log('编辑器初始化完成！');
    $(".sde-icon-savexml").css("background-image","url(./EMREditor/imgs/保存.png)");
    $(".sde-icon-openxml").css("background-image","url(./EMREditor/imgs/打开.png)");
    $(".sde-icon-importxml").css("background-image","url(./EMREditor/imgs/下载.png)");
    $(".sde-icon-print").css("background-image","url(./EMREditor/imgs/打印.png)");
    $(".sde-icon-inserttable").css("background-image","url(./EMREditor/imgs/插入表格.png)");
    $(".sde-icon-deletetable").css("background-image","url(./EMREditor/imgs/删除表格.png)");
    $(".sde-icon-deleterow").css("background-image","url(./EMREditor/imgs/删除表格行.png)");
    $(".sde-icon-deletecol").css("background-image","url(./EMREditor/imgs/删除表格列.png)");
    $(".sde-icon-insertrow").css("background-image","url(./EMREditor/imgs/在下面插入表格行.png)");
    $(".sde-icon-insertcol").css("background-image","url(./EMREditor/imgs/在右侧插入表格列.png)");
    $(".sde-icon-tablestyle").css("background-image","url(./EMREditor/imgs/表格样式设置.png)");
    $(".sde-icon-openinsertimage").css("background-image","url(./EMREditor/imgs/图片管理.png)");
    $(".sde-icon-simpleupload").css("background-image","url(./EMREditor/imgs/图片插入.png)");
    $(".sde-icon-scrawl").css("background-image","url(./EMREditor/imgs/涂鸦标记.png)");
    $(".sde-icon-kityformula").css("background-image","url(./EMREditor/imgs/公式.png)");
    $(".sde-icon-spechars").css("background-image","url(./EMREditor/imgs/特殊字符.png)");
    $(".sde-icon-pagebreak").css("background-image","url(./EMREditor/imgs/插入分页符.png)");

    $(".sde-icon-sdectrltext").css("background-image","url(./EMREditor/imgs/单行文本.png)");
    $(".sde-icon-sdectrllabel").css("background-image","url(./EMREditor/imgs/标签.png)");
    $(".sde-icon-sdectrldate").css("background-image","url(./EMREditor/imgs/日期控件.png)");
    $(".sde-icon-sdectrlselect").css("background-image","url(./EMREditor/imgs/下拉框.png)");
    $(".sde-icon-sdectrlradio").css("background-image","url(./EMREditor/imgs/单选框_选中.png)");
    $(".sde-icon-sdectrlcbx").css("background-image","url(./EMREditor/imgs/复选框-选中.png)");
    $(".sde-icon-sdectrlsection").css("background-image","url(./EMREditor/imgs/文档段.png)");
  });

}

